<template>
  <div>
    <el-dialog title="配置选项" :visible.sync="dialogFormVisible" append-to-body width="65%">
      <el-tabs v-model="activeName">
        <!-- 这里是物理接口 -->
        <el-tab-pane label="物理网口配置" name="first">
          <el-form label-width="120px" label-position="left" ref="physicalInterfaces">
            <el-table :data="tableData" border style="width: 100%">
              <el-table-column prop="date" label="接口名称" width="360"></el-table-column>
              <el-table-column label="操作" width="180">
                <template slot-scope="scope">
                  <el-button type="text" @click="interfaceEdit (scope.row.id)" size="small">编辑</el-button>
                </template>
              </el-table-column>
            </el-table>
            <!-- <el-form-item label="接口名称"  prop="interfaceName">
                          <el-input v-model="physicalInterfaces.interfaceName" class="adjustInp" :disabled="true" vlaue="1"></el-input>
                      </el-form-item>
                      <el-form-item label="工作模式"  prop="operatingMode">
                          <el-select v-model="physicalInterfaces.operatingMode" placeholder="请选择" @change="WorkingMode">
                              <el-option label="路由模式" :value="0"></el-option>
                              <el-option label="透明模式" :value="1"></el-option>
                          </el-select>
                      </el-form-item>
                      <el-form-item label="IP地址获取"  prop="ipobtainMode">
                          <el-select v-model="physicalInterfaces.ipobtainMode"  :disabled="distinguish"  @change="staticxz" placeholder="请选择">
                              <el-option label="通过DHCP获得" :value="0"></el-option>
                              <el-option label="静态配置" :value="1"></el-option>
                          </el-select>
                      </el-form-item>
                      <el-form-item label="IP地址" prop="ipaddressAndMask01">
              <el-input v-model="physicalInterfaces.ipaddressAndMask01" class="adjustInp" :disabled="distinguish || newDistinguish" vlaue=""></el-input>
            </el-form-item>
                      <el-form-item label="掩码" prop="ipaddressAndMask02">
              <el-input v-model="physicalInterfaces.ipaddressAndMask02" class="adjustInp" :disabled="distinguish || newDistinguish" vlaue=""></el-input>
            </el-form-item>
                      <el-form-item label="启用">
                          <el-checkbox v-model="physicalInterfaces.enableFlag"></el-checkbox>
                      </el-form-item> -->
          </el-form>
        </el-tab-pane>
        <!-- 这里是 桥接口-->
        <!-- <el-tab-pane label="桥接口配置" name="second" :disabled="!distinguish && !distinguish02">
                  <el-form  label-width="120px" label-position="left" :model="bridgeInterfaceConfiguration1">
                      <el-form-item label="接口名称">
                          <el-input v-model="bridgeInterfaceConfiguration1.interfaceName" class="adjustInp" :disabled="true" vlaue="1"></el-input>
                      </el-form-item>
                      <el-form-item label="绑定接口选择">
                          <el-transfer
                              :titles="['可选接口列表','绑定接口列表']"
                              >
                          </el-transfer>
                      </el-form-item>
                      <el-form-item label="启用">
                          <el-checkbox></el-checkbox>
                      </el-form-item>
                  </el-form>
              </el-tab-pane> -->
        <!-- 这里是路由-->
        <el-tab-pane label="路由配置" name="third" :disabled="distinguish">
          <!-- 这是分割线 -->
          <p class="topBar"><span @click="addRouter">新建路由</span></p>
          <el-table
            :data="routingConfigurations"
            border
            style="width: 100%">
            <el-table-column
              prop="destinationAddress"
              label="目的地址"
              width="180">
            </el-table-column>
            <el-table-column
              prop="mask"
              label="掩码"
              width="180">
            </el-table-column>
            <el-table-column
              prop="priority"
              label="优先级">
            </el-table-column>
            <el-table-column
              prop="nextHop"
              label="下一跳">
            </el-table-column>
            <el-table-column
              prop="outflowInterface"
              label="网络接口">
            </el-table-column>
            <el-table-column
              prop="weights"
              label="权重">
            </el-table-column>
            <el-table-column
              fixed="right"
              label="操作"
              width="120">
              <template slot-scope="scope">
                <el-button
                  @click.native.prevent="deleteRow(scope.$index, routingConfigurations)"
                  type="text"
                  size="small">
                  移除
                </el-button>
                <el-button
                  @click="editRouter(scope.row,scope.$index)" size="small" type="text">
                  编辑
                </el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <!-- 这里是地址 -->
        <el-tab-pane label="地址列表配置" name="fourth">
          <el-form label-width="120px" label-position="left" :model="addressLists">
            <el-form-item label="接口名称">
              <el-input v-model="addressLists.name" class="adjustInp" vlaue="1"></el-input>
            </el-form-item>
            <el-form-item label="地址">
              <el-col :span="24">
                <el-input style="width: 200px;" v-model='addressLists.ipAddress1'></el-input>
                /
                <el-select placeholder="" v-model="addressLists.ipAddress2">
                  <el-option label="255.255.255.0" value="255.255.255.0"></el-option>
                </el-select>
              </el-col>
            </el-form-item>
          </el-form>
        </el-tab-pane>
        <!-- 这里是安全策略 -->
        <el-tab-pane label="安全策略配置" name="five">
          <el-form :inline="true" :model="strategyList" label-width="90px" label-position="left">
            <el-col :span="12">
              <el-form-item label="规则名">
                <el-input v-model="strategyList.strategyName"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="序号">
                <el-input v-model.number="strategyList.serialNumber"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="源地址">
                <el-select v-model="strategyList.sourceAddress" style="max-width:179px">
                  <el-option label="testnet" value="testnet"></el-option>
                  <!-- <el-option label="区域二" value="testnet"></el-option> -->
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="目的地址">
                <el-select v-model="strategyList.destinationAddress" style="max-width:179px">
                  <el-option label="testnet" value="testnet"></el-option>
                  <!-- <el-option label="区域二" value="testnet"></el-option> -->
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="源端口">
                <el-input v-model.number="strategyList.sourcePort"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="服务">
                <el-select v-model="strategyList.service" style="max-width:179px">
                  <el-option label="any" value="any"></el-option>
                  <!-- <el-option label="服务二" value="any"></el-option> -->
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="访问控制">
                <el-radio-group v-model="strategyList.accessControl">
                  <el-radio :label="1">允许</el-radio>
                  <el-radio :label="0">禁止</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-form>
        </el-tab-pane>
        <!-- 规则 -->
        <el-tab-pane label="规格配置" name="six">
          <el-form :inline="true" label-width="90px" label-position="left">
            <el-form-item label="规格模板">
              <el-select v-model="createVM" value-key="did" placeholder="请选择模板" @change="newcreateVm">
                <el-option v-for="itme in allCreateVM" :label="itme.dname" :key="itme.did" :value="itme"></el-option>
              </el-select>
            </el-form-item>
            <br/>
            <el-form-item label="CPU">
              <el-input v-model="createVM.cpu" class="adjustInp" :disabled="true"
                        style="width: 200px;background-color: #fff;"></el-input>
            </el-form-item>
            <br/>
            <el-form-item label="磁盘空间">
              <el-input v-model="createVM.disk" class="adjustInp" :disabled="true"
                        style="width: 200px;background-color: #fff;"></el-input>
            </el-form-item>
            <br/>
            <el-form-item label="内存">
              <el-input v-model="createVM.memory" class="adjustInp" :disabled="true"
                        style="width: 200px;background-color: #fff;"></el-input>
            </el-form-item>
          </el-form>
        </el-tab-pane>
      </el-tabs>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="surBtn()">确 定</el-button>
      </div>
      <el-dialog title="物理网口配置" :visible.sync="interfacesShow" width="50%" append-to-body>
        <el-form ref="form" :model="physicalInterfaces" label-width="100px">
          <el-form-item label="接口名称" prop="interfaceName">
            <el-input v-model="physicalInterfaces.interfaceName" class="adjustInp" :disabled="true" vlaue="1"
                      style="width:200px"></el-input>
          </el-form-item>
          <el-form-item label="工作模式">
            <el-select v-model="physicalInterfaces.operatingMode" placeholder="请选择">
              <el-option label="路由模式" :value="0"></el-option>
              <!-- <el-option label="透明模式" :value="1"></el-option> -->
            </el-select>
          </el-form-item>
          <el-form-item label="网络">
            <el-select v-model="physicalInterfaces.netWorkName" placeholder="请选择">
              <el-option v-for="(item,index) in netWorkName" :key="index" :label="item" :value="item"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="IP地址获取">
            <el-select v-model="physicalInterfaces.ipobtainMode" placeholder="请选择" @change="staticxz">
              <el-option label="通过DHCP获取" :value="0"></el-option>
              <el-option label="静态配置" :value="1"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="IP地址">
            <el-input v-model="ipaddressAndMask01" class="adjustInp" :disabled="newDistinguish"
                      style="width:200px"></el-input>
          </el-form-item>
          <el-form-item label="掩码">
            <el-input v-model="ipaddressAndMask02" class="adjustInp" :disabled="newDistinguish"
                      style="width:200px"></el-input>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
        <el-button @click="interfacesShow = false">取 消</el-button>
        <el-button type="primary" @click="interfacesSurBtn(interfacesId)">确 定</el-button>
      </span>
      </el-dialog>
    </el-dialog>
    <el-dialog
      title="新建路由"
      :visible.sync="dialogVisible"
      width="500px"
      append-to-body>
      <el-form label-width="120px" label-position="left" :model="routingConfigurationsObj">
        <el-form-item label="目的地址">
          <el-input v-model="routingConfigurationsObj.destinationAddress" class="adjustInp"
                    placeholder="请输入IP地址类型（IPv4）"></el-input>
        </el-form-item>
        <el-form-item label="掩码">
          <el-input v-model="routingConfigurationsObj.mask" class="adjustInp" vlaue="1"></el-input>
        </el-form-item>
        <el-form-item label="优先级">
          <el-input class="adjustInp" v-model.number="routingConfigurationsObj.priority"></el-input>
          <span>（1~9999）</span>
        </el-form-item>
        <el-form-item label="下一跳">
          <el-input class="adjustInp" v-model="routingConfigurationsObj.nextHop"></el-input>
        </el-form-item>
        <el-form-item label="网络接口">
          <el-select v-model="routingConfigurationsObj.outflowInterface">
            <el-option label="eth1" value="eth1"></el-option>
            <el-option label="eth2" value="eth2"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="权重">
          <el-input class="adjustInp" v-model.number="routingConfigurationsObj.weights"></el-input>
          <span>（1~255）</span>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="confirm">确 定</el-button>
    </span>
    </el-dialog>
  </div>
</template>

<script>
    import {constants} from 'fs';
    import vnf from "../component/vnf";

    const defaultRoutingObj = {
        destinationAddress: "10.100.0.103", //IP地址（IPv4）
        mask: "255.255.255.0", //IP掩码类型
        nextHop: "10.1.0.103", //IP地址（IPv4）  下一跳地址的子网需要和流出网口配置的子网相同
        outflowInterface: "eth2",	//选项：配置为路由模式的物理接口
        priority: 1, //1-9999
        weights: 1 //1-255
    }

    export default {
        data() {
            const generateData = () => {
                const data = []
                for (let i = 1; i <= 4; i++) {
                    data.push({
                        key: i,
                        label: `备选项${i}`,
                        // disabled: i % 4 === 0
                    })
                }
                return data
            }
            return {
                // 下面是bug修改的数据
                index: 0,
                edit: false,
                chainsIndex:0,
                vnfIndex:0,
                vnfType:0,
                ipaddressAndMask01: '',
                // ipaddressAndMask01: '10.100.0.111',
                ipaddressAndMask02: '',
                // 下面是bug修改的数据
                dialogVisible: false,
                netWorkName: [],
                activeName: 'first', // TAS选项默认第一个
                dialogFormVisible: false, // 弹出框开关
                flagBridge: false,
                interfacesShow: false, // 物理网口配置
                disableRouter: false,
                distinguish: false, // 透明模式禁用
                distinguish02: true,
                newDistinguish: false,
                transferList: generateData(),
                // 1、物理接口数据
                physicalInterfaces: {
                    interfaceName: "eth1",	// 系统默认生成，用户不可修改。如：eth0、eth1
                    ipaddressAndMask: "",	// IP地址/mask IP地址获取选择为"静态配置"时需要配置
                    ipaddressAndMask01: '',
                    // ipaddressAndMask01: '10.100.0.111',
                    ipaddressAndMask02: '',
                    // ipaddressAndMask02: '255.255.255.0',
                    ipobtainMode: 1, // 0:通过DHCP获取;1:静态配置  工作模式选择为"路由模式"时需要进行配置
                    operatingMode: 0, // 0:路由模式;1:透明模式
                    enableFlag: true, // 0:不启用、1:启用  可以不设此配置项，默认启用
                    netWorkName: ''
                },
                physicalInterfacesList: [],
                // 2、 桥接配置
                // bridgeInterfaceConfiguration1: {
                // 	bindInterfaces: [
                // 		{
                // 			interfaceName: ""
                // 		}
                // 	],
                // 	enableFlag: 0,
                // 	interfaceName: ""
                // },
                // 3、路由配置
                routingConfigurationsObj: {
                    destinationAddress: "10.100.0.103", //IP地址（IPv4）
                    mask: "255.255.255.0", //IP掩码类型
                    nextHop: "10.1.0.103", //IP地址（IPv4）  下一跳地址的子网需要和流出网口配置的子网相同
                    outflowInterface: "eth2",	//选项：配置为路由模式的物理接口
                    priority: 1, //1-9999
                    weights: 1 //1-255
                },
                routingConfigurations: [],
                router: {
                    tabList: [{}]
                },
                // 4、地址列表配置
                addressLists: {
                    name: 'testnet',
                    ipAddress: '',
                    ipAddress1: '10.100.0.16', // (子网)IP地址类型(IPv4)/掩码例如：1.1.1.1/255.255.255.0 或(区间)IP地址类型(IPv4)-IP地址类型(IPv4)例如：1.1.1.1-1.1.1.100
                    ipAddress2: '255.255.255.0',
                },
                // 5、安全策略
                strategyList: {
                    accessControl: 1,
                    destinationAddress: 'testnet', // 目的地址列表
                    intrusionPreventionStrategy: 0,
                    logFlag: 1,
                    serialNumber: '1', // 代表策略优先级
                    service: 'any', // 服务类型
                    sourceAddress: 'testnet', // 源地址列表
                    sourcePort: 'none', // 源端口
                    strategyName: 'testnet' // 策略名称
                },
                securityStrategy: {
                    userGroup: null,
                    radio: '1',
                    checked: false,
                    // logFlag:0,
                },
                // 规则
                createVM: {},
                allCreateVM: [],
                tableData: [
                    {
                        date: 'eth1',
                        id: 0
                    },
                    {
                        date: 'eth2',
                        id: 1
                    }
                ]
            }
        },
        methods: {
            confirm() {
                if (this.edit) {
                    let obj = Object.assign({}, this.routingConfigurationsObj, this.routingConfigurationsObj)
                    this.routingConfigurations[this.index] = obj;
                } else {
                    let obj = Object.assign({}, this.routingConfigurationsObj, this.routingConfigurationsObj)
                    this.routingConfigurations.push(obj);
                }

                this.dialogVisible = false;

            },
            deleteRow(index, rows) {
                rows.splice(index, 1);
            },
            editRouter(row, index) {
                debugger
                this.edit = true;
                this.index = index;
                this.dialogVisible = true;
                this.routingConfigurationsObj = row;
                // if (this.edit) {
                //     this.routingConfigurationsObj = row;
                //     // this.routingConfigurations[this.index] = row;
                // } else {
                //     this.routingConfigurationsObj = row;
                // }

            },
            addRouter() {
                this.edit = false;
                this.index = 0;
                this.dialogVisible = true;
            },
            getnetwork() {
                this.$http({
                    url: this.$http.adornUrl('/vm/networkList'),
                    method: 'post',
                }).then(({data}) => {
                    // console.log(data.list, 'network....')
                    if (data.list.length !== 0 || data.list !== unedfined || data.list !== null) {
                        this.netWorkName = data.list

                    }
                    // console.log(this.netWorkName,'network....')
                }).catch(error => {
                    this.$message({
                        showClose: false,
                        message: '程序异常,请联系管理员',
                        type: 'warning'
                    })
                })
            },
            newcreateVm(val) {
                console.log(val, '333', this.createVM)
            },
            firewallShow(val,vnfIndex, vnfType, list) {
                debugger
                this.activeName = 'first'
                this.dialogFormVisible = true
                this.chainsIndex = val
                this.vnfIndex = vnfIndex
                this.vnfType = vnfType
                this.physicalInterfacesList = []
                this.routingConfigurations = []
                this.routingConfigurationsObj = Object.assign({},JSON.parse(JSON.stringify(defaultRoutingObj)))

                this.dataDocking()
                let fireData = list[val].vnfs[vnfIndex]
                if (list && fireData && fireData.firewall) {
                    var pos = fireData.firewall.addressLists[0].ipAddress.split('/')
                    this.addressLists.ipAddress1 = pos[0]
                    this.addressLists.ipAddress2 = pos[1]
                    this.addressLists.name = fireData.firewall.addressLists[0].name
                    this.physicalInterfacesList = fireData.firewall.physicalInterfaces
                    // this.bridgeInterfaceConfiguration1 = list.firewall.bridgeInterfaceConfiguration1 || this.bridgeInterfaceConfiguration1
                    // this.routingConfigurationsObj = fireData.firewall.routingConfigurations ? fireData.firewall.routingConfigurations[0] : this.routingConfigurationsObj
                    this.routingConfigurations = fireData.firewall.routingConfigurations ?  fireData.firewall.routingConfigurations : []
                    this.strategyList = fireData.firewall.strategyList ? fireData.firewall.strategyList[0] : this.strategyList
                }
                if (list && fireData && fireData.createVM) {
                    this.createVM.cpu = fireData.createVM.vcpusNeed
                    this.createVM.memory = fireData.createVM.memoryNeed
                    this.createVM.disk = fireData.createVM.diskGbNeed
                    this.createVM.dId = fireData.createVM.tmpId
                }
            },
            WorkingMode(val) { // 工作模式
                if (val !== 1) {
                    this.distinguish = false
                    this.distinguish02 = false
                } else {
                    this.distinguish = true
                    this.distinguish02 = true
                    this.physicalInterfaces.ipaddressAndMask01 = ''
                    this.physicalInterfaces.ipaddressAndMask02 = ''
                    // 下面是bug修改增加的代码
                    this.ipaddressAndMask01 = ''
                    this.ipaddressAndMask02 = ''
                    // 下面是bug修改增加的代码

                    this.physicalInterfaces.ipobtainMode = ''
                }
            },
            staticxz(val) {
                if (val !== 1) {
                    this.newDistinguish = true
                    this.physicalInterfaces.ipaddressAndMask01 = ''
                    this.physicalInterfaces.ipaddressAndMask02 = ''
                    // 下面是bug修改增加的代码
                    this.ipaddressAndMask01 = '';
                    this.ipaddressAndMask02 = '';
                    // 下面是bug修改增加的代码
                } else {
                    this.newDistinguish = false
                }
            },
            interfaceEdit(id) { // 显示物理接口eth0或eth1数据配置表
                debugger
                this.physicalInterfaces.interfaceName = 'eth' + (id + 1)
                this.interfacesId = id
                this.physicalInterfaces.ipaddressAndMask01 = ''
                this.physicalInterfaces.ipaddressAndMask02 = ''
                // 下面是bug修改增加的代码
                this.ipaddressAndMask01 = '';
                this.ipaddressAndMask02 = '';
                // 下面是bug修改增加的代码
                if (this.physicalInterfacesList.length >= (id + 1)) {
                    this.physicalInterfaces = this.physicalInterfacesList[id]
                    let dataMask = this.physicalInterfaces.ipaddressAndMask.split('/')
                    this.physicalInterfaces.ipaddressAndMask01 = dataMask[0]
                    this.physicalInterfaces.ipaddressAndMask02 = dataMask[1]


                    // 下面是bug修改增加的代码
                    this.ipaddressAndMask01 = dataMask[0];
                    this.ipaddressAndMask02 = dataMask[1];
                    // 下面是bug修改增加的代码


                } else { // 以后删除代码用
                    let physicalInterfaces01 = {
                        interfaceName: "eth1",
                        ipaddressAndMask: "10.100.0.111/255.255.255.0",
                        ipobtainMode: 1,
                        operatingMode: 0,
                        enableFlag: true,
                        netWorkName: '',
                    }
                    let physicalInterfaces02 = {
                        interfaceName: "eth2",
                        ipaddressAndMask: "10.100.0.122/255.255.255.0",
                        ipobtainMode: 1,
                        operatingMode: 0,
                        enableFlag: true,
                        netWorkName: '',
                    }
                    if (id === 0){
                        this.physicalInterfacesList[0] = physicalInterfaces01
                    } else if (id === 1) {
                        this.physicalInterfacesList[1] = physicalInterfaces02
                    }


                    this.physicalInterfaces = this.physicalInterfacesList[id]
                    let dataMask = this.physicalInterfaces.ipaddressAndMask.split('/')
                    this.physicalInterfaces.ipaddressAndMask01 = dataMask[0]
                    this.physicalInterfaces.ipaddressAndMask02 = dataMask[1]
                    // 下面是bug修改增加的代码
                    this.ipaddressAndMask01 = dataMask[0];
                    this.ipaddressAndMask02 = dataMask[1];
                    // 下面是bug修改增加的代码
                }
                this.interfacesShow = true
            },
            interfacesSurBtn(id) { // 显示物理接口eth0或eth1数据
                debugger
                // this.physicalInterfaces.ipaddressAndMask = this.physicalInterfaces.ipaddressAndMask01 + '/' + this.physicalInterfaces.ipaddressAndMask02
                // this.physicalInterfaces.ipaddressAndMask === '/' ? this.physicalInterfaces.ipaddressAndMask = '' : this.physicalInterfaces.ipaddressAndMask
                this.physicalInterfaces.ipaddressAndMask = this.ipaddressAndMask01 + '/' + this.ipaddressAndMask02
                this.physicalInterfaces.ipaddressAndMask === '/' ? this.physicalInterfaces.ipaddressAndMask = '' : this.physicalInterfaces.ipaddressAndMask

                this.physicalInterfaces.enableFlag = this.physicalInterfaces.enableFlag === true ? 1 : 0
                this.physicalInterfacesList[id] = JSON.parse(JSON.stringify(this.physicalInterfaces))
                this.interfacesShow = false
            },
            dataDocking() { // 接口获取规则配置数据
                this.$http({
                    url: this.$http.adornHardWareUrl('/generator/deploy/listAll'),
                    method: 'get',
                    params: this.$http.adornParams()
                }).then(({data}) => {
                    if (data && data.code == '0') {
                        this.allCreateVM = data.all
                    }
                })
            },
            surBtn() {
                debugger
                this.addressLists.ipAddress = this.addressLists.ipAddress1 + '/' + this.addressLists.ipAddress2
                this.addressLists.ipAddress === '/' ? this.addressLists.ipAddress = '' : this.addressLists.ipAddress

                let firewall = {
                    physicalInterfaces: [], // 物理网配置
                    // bridgeInterfaceConfiguration1: this.bridgeInterfaceConfiguration1, // 桥接数据
                    firewallName: 'H' + new Date().getTime(),
                    fwType: 0,
                    interfaceTraffic: 0,
                    routingConfigurations: [],  // 路由
                    addressLists: [], // 地址列表
                    strategyList: []  //  策略
                }

                firewall.physicalInterfaces = JSON.parse(JSON.stringify(this.physicalInterfacesList))
                firewall.routingConfigurations = JSON.parse(JSON.stringify(this.routingConfigurations))
                // firewall.routingConfigurations.push( JSON.parse(JSON.stringify(this.routingConfigurationsObj)))
                // firewall.routingConfigurations[0] = JSON.parse(JSON.stringify(this.routingConfigurationsObj))
                firewall.addressLists[0] = JSON.parse(JSON.stringify(this.addressLists))
                firewall.strategyList[0] = JSON.parse(JSON.stringify(this.strategyList))
                this.$emit('firewallData', this.chainsIndex,this.vnfIndex, this.vnfType, firewall, 'fhq', this.createVM)
                this.dialogFormVisible = false
            }
        },
        watch: {},
        mounted() {
            this.getnetwork();
        }
    }
</script>

<style scoped="scoped">
  .topBar {
    display: block;
    margin: 0;
    padding: 0 14px;
    margin-bottom: 6px;
    color: #3E8EF7;
    height: 20px;
    font: 16px/20px '微软雅黑';
    text-align: right;
  }

  .adjustInp {
    width: 204px;
  }
</style>
